﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using UMEVOR.BLL;
using UMEVOR.DTO;
using UMEVOR.VO;

public partial class Portal_divulgadorImp : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack && !this.IsCallback)
        {
            if (!Session["palestrante"].ToString().Equals(""))
            {
                BLLT_PALESTRA bllPalestra = new BLLT_PALESTRA();
                gvPalestra.DataSource = bllPalestra.consultar(Session["palestrante"].ToString(), 0, DateTime.Parse("01/01/0001"));
                gvPalestra.DataBind();
            }
            else
            {
                BLLT_PALESTRA bllPalestra = new BLLT_PALESTRA();
                gvPalestra.DataSource = bllPalestra.consultar("", 0, DateTime.Parse("01/01/0001"));
                gvPalestra.DataBind();
            }
        }

    }
    protected void gvPalestra_RowCreated(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.DataItem != null)
        {
            VOT_PALESTRA palestra = (VOT_PALESTRA)e.Row.DataItem;

            Label lblHorario = (Label)e.Row.FindControl("lblHorario");


            string hora = palestra.HR_PALESTRA.ToString("HH:mm");

            if (hora.Equals("00:00"))
                hora = "";

            lblHorario.Text = palestra.DT_PALESTRA.ToString("dd/MM/yyyy") + " " + hora;
        }
    }
}
